#{extends 'template/main.html' /}
#{set title:'areaAdm' /}

<fieldset>
<legend><span class="glyphicon glyphicon-user"></span> Área do Administrador</legend>


<div id="botoesMenu">
	<ul class="nav navbar-nav navbar-right">
		<li><a data-toggle="modal" href="@{Nutricionistas.form()}"><button type="submit" class="btn btn-success btn-sm" title="Adicionar Nutricionista">
				<span class="glyphicon glyphicon-plus"></span> Adicionar Nutricionista
			</button></a>
		</li>
	</ul>
</div>

<div class="panel panel-danger">
  <div class="panel-heading">
  	<h4><span class="glyphicon glyphicon-list-alt"></span> Nutricionistas</h4>
  </div>
  <div class="panel-body">
  	#{if !nutricionistas.empty}
<table class="table table-striped">
				<thead>
					<tr>
						<th>Nome</th>
						<th>CPF</th>
						<th>Telefone</th>
						<th>Celular</th>
						<th>Email</th>
						<th>CRN</th>
						<th>Ações</th>
					</tr>
				</thead>
				<tbody>
					#{list items:nutricionistas, as: 'nutricionista'}
					<tr>
						<td>${nutricionista.nome}</td>
						<td>${nutricionista.cpf}</td>						
						<td>${nutricionista.telefone}</td>
						<td>${nutricionista.celular}</td>
						<td>${nutricionista.email}</td>
						<td>${nutricionista.crn}</td>
						<td><a data-toggle="modal" href="@{nutricionistas.show(nutricionista.id)}"
							class="glyphicon glyphicon-edit" title="Editar"></a>
							<a href="@{nutricionistas.excluir(nutricionista.id)}"
							class="glyphicon glyphicon-trash" title="Excluir"  onclick="return confirm('Tem certeza que deseja excluir?')"></a>
							</td>
					</tr>
					#{/list}
				</tbody>
			</table>
			#{/if}
  </div>
</div>


			</fieldset>
		
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title">Novo Nutricionista </h4>
          <ul class="nav navbar-nav navbar-right">
          <li><span class="label label-danger">Campos Obrigatórios</span></li>
          </ul>
          
          
        </div>
        <form class="form-horizontal" role="form" action="@{Nutricionistas.salvar()}">
        <div class="modal-body">
         	
         		<div class="form-group">
			    <label for="inputNome1" class="col-lg-2 control-label">Nome</label>
			    <span class="error">#{error 'nutricionista.nome' /}</span>
			    <div class="col-lg-10">
			      <input type="text" class="form-control" id="inputNome1" name="nutricionista.nome" placeholder="Nome" value="${flash['nutricionista.nome']}">
			    </div>
			  </div>
			  <div class="form-group has-error" >
			    <label for="inputCpf1" class="col-lg-2 control-label">CPF</label>
			    <div class="col-lg-10">
			      <input type="text" class="form-control" id="inputCpf1" name="nutricionista.cpf"  placeholder="CPF" value="${flash['nutricionista.cpf']}">
			    </div>
  			</div>
  			<div class="form-group">
			    <label for="inputTelefone1" class="col-lg-2 control-label">Telefone</label>
			    <div class="col-lg-10">
			      <input type="text" class="form-control" id="inputTelefone1" name="nutricionista.telefone"  placeholder="Telefone" value="${flash['nutricionista.telefone']}">
			    </div>
  			</div>
  			<div class="form-group">
			    <label for="inputCelular1" class="col-lg-2 control-label">Celular</label>
			    <div class="col-lg-10">
			      <input type="text" class="form-control" id="inputCpf1" name="nutricionista.celular"  placeholder="Celular" value="${flash['nutricionista.celular']}">
			    </div>
  			</div>
  			<div class="form-group">
			    <label for="inputEmail1" class="col-lg-2 control-label">Email</label>
			    <div class="col-lg-10">
			      <input type="text" class="form-control" id="inputEmail1" name="nutricionista.email"  placeholder="CPF" value="${flash['nutricionista.email']}">
			    </div>
  			</div>
  			<div class="form-group">
			    <label for="inputCrn1" class="col-lg-2 control-label">CRN</label>
			    <div class="col-lg-10">
			      <input type="text" class="form-control" id="inputCrn1" name="nutricionista.crn"  placeholder="CRN" value="${flash['nutricionista.crn']}">
			    </div>
  			</div>
  			<div class="form-group">
			    <label for="inputLogin1" class="col-lg-2 control-label">Login</label>
			    <div class="col-lg-10">
			      <input type="text" class="form-control" id="inputLogin1" name="nutricionista.login"  placeholder="Login" value="${flash['nutricionista.login']}">
			    </div>
  			</div>
  			<div class="form-group">
			    <label for="inputSenha1" class="col-lg-2 control-label">Senha</label>
			    <div class="col-lg-10">
			      <input type="text" class="form-control" id="inputSenha1" name="nutricionista.senha"  placeholder="Senha" value="${flash['nutricionista.senha']}">
			    </div>
  			</div>
         	
        </div>
        <div class="modal-footer">
          <a href="@{Administradores.index()}" type="button" class="btn btn-default" data-dismiss="modal">Cancelar</a>
          <button type="submit" class="btn btn-success" id="btn-save" >Salvar</button>
        </div></form>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->
 